iT邦幫忙

0

VBA 16進位轉10進位

  • 分享至 

  • xImage
  •  
Function HextoDec(hex As String)
Dim i As Byte, l As Byte, d As String, dec As Long
l = Len(hex)
For i = 1 To l
    d = Mid(hex, i, 1)
    If d Like "[0-9]" Then
        'dec = dec + CByte(d) * 16 ^ (l - 1)
    Else
        Select Case d
            Case "A"
                d = "10"
            Case "B"
                d = "11"
            Case "C"
                d = "12"
            Case "D"
                d = "13"
            Case "E"
                d = "14"
            Case "F"
                d = "15"
        End Select
    End If
    dec = dec + CByte(d) * 16 ^ (l - i)
Next i
HextoDec = dec
End Function

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言